﻿<!--#include file="const.inc"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
%>

<%
	dim rs,sql,i,name,act,page,fleg,listidd

    		Page = Request.QueryString("page")      '当前页数
    		If Page = "" Then Page = 1
   		If Not IsNumeric(Page) Then Page = 1
    		Page = CLng(Page)
    		If Page < 1 Then Page = 1
                id=Request.QueryString("id")
    		If id = "" Then id = qingtian.nid
	        if not isnumeric(id) then id=qingtian.nid
	        id=clng(id)
                name=qingtian.name(id)
                act=Request.QueryString("act")
if act=1 and qingtian.bbs=true then
set rs=Server.CreateObject("Adodb.Recordset")
			rs.open "select * from qingtian_bbs_forum where nid="&id&" and del=0 order by id desc" ,conn,1,3
			if not (rs.bof and rs.eof)  then
				For i=1 to rs.RecordCount
					If Rs.Eof Then
						exit For
					End If
					rs.delete
				set rst=server.CreateObject("adodb.recordset")
				sqlt="select * from [qingtian_bbs_forum] where id="&rs("topicid")
				rst.open sqlt,conn,1,3
				if not (rst.bof and rst.eof)  then
					rst("reply")=rst("reply")-1
					rst.update
				rst.update()
				end if
				Rst.close
				set rst=nothing
					Rs.MoveNext
				Next

			end if
			Rs.close
			set rs=nothing
end if
select case v
case "0"
we0="<br/>"
hr="----------------<br/>"
%>
<card title="<%=name%>的帖子"><p align="<%=qingtian.px%>">
<%
case "1"
hr=""
zi="<span style=""color:#FF5500"">"
zi0="</span>"
we="<div class=""footer"">"
sou="<div class=""block4"">"
dao="<div class=""navi"">"
we0="</div>"
we1="</div>"
%>
<title><%=name%>的帖子</title>
</head>
<body>
<!--#include virtual="/css.inc"-->
<%

End Select


		if sid="Null" then Response.Redirect "/login.asp?sid="&sidd&"&url=/user/mytopic.asp?sid="&sidd
		qingtian.info
%>
<%=qingtian.qingsav("355")%><%=dao%><a href="/bbs/index.asp?sid=<%=sidd%>">论坛</a>&gt;<a href="spacev.asp?nid=<%=id%>&amp;sid=<%=sidd%>"><%=name%>的空间</a><br/><%=name%>的帖子<%=we0%><%=hr%>
<%
           Set Rs = Server.CreateObject("Adodb.Recordset")
           Sql = "select id,listid,name from [qingtian_bbs_forum] where nid="&id&" and del=0 order by id desc"
		Rs.Open Sql,conn,1,1
		if not (rs.bof and rs.eof)  then
				Rs.PageSize = 15	'一页N条记录
				IF Not IsEmpty(Page) Then
					IF Not IsNumeric(Page) Then		'判断Page是否为数字
						Page=1
					Else
						Page=Cint(Page)		'转换成短整形Integer
					End IF
					IF Page > Rs.PageCount Then
						Rs.AbsolutePage = Rs.PageCount	'设置当前显示页等于最后一页
					ElseIF Page <= 0 Then
						Rs.AbsolutePage = 1		'设置当前页等于第一页
					Else
						Rs.AbsolutePage = Page	'如果大于零,显示当前页等于接收的页数
					End IF
				Else
					Rs.AbsolutePage = 1
				End IF
				Page = Rs.AbsolutePage


		For i=1 to  Rs.PageSize
		If Rs.Eof Then
			exit For
		End If
dat=i+(page-1)*Rs.PageSize
dat1=dat mod 2
if dat1=0 then
%>			
<%=we%><%=dat%>.<a href="/bbs/viewv.asp?id=<%=rs("id")%>&amp;listid=<%=rs("listid")%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs("name"))%></a><%=we0%>
<%
else
%>
<%=sou%><%=dat%>.<a href="/bbs/viewv.asp?id=<%=rs("id")%>&amp;listid=<%=rs("listid")%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs("name"))%></a><%=we0%>
<%
End If
			
	 	Rs.MoveNext
	  	Next

           	If rs.PageCount > 1 Then
    		    %>
		<%=dao%>
		<%
    		End If
 
   		'分页

    		If Page < rs.PageCount Then
    		    Response.Write("<a href='mytopic.asp?id=" & id & "&amp;page=" & Page + 1 & "&amp;sid="&sidd&"'>下页</a>")
    		End If
   		If Page > 1 Then
    		    Response.Write("<a href='mytopic.asp?id=" & id & "&amp;page=" & Page - 1 & "&amp;sid="&sidd&"'>上页</a>")
    		End If
    		If Page < rs.PageCount Then
    		    Response.Write("<a href='mytopic.asp?id=" & id & "&amp;page=" & rs.PageCount & "&amp;sid="&sidd&"'>末页</a>")
    		End If
    		If Page > 1 Then
    		    Response.Write("<a href='mytopic.asp?id=" & id & "&amp;page=1&amp;sid="&sidd&"'>首页</a>"&we0&"")
    		Elseif rs.PageCount >1 then
    		    Response.Write we0
    		End If
    		If rs.PageCount > 1 Then            
     		    Response.Write("" & we & "[第"&Page&"/总"&rs.PageCount&"页/"&rs.RecordCount&"条]"&we0&"")
    		End If
                if qingtian.bbs=true then Response.Write("" & dao & "<a href='mytopic.asp?id="&id&"&amp;act=1&amp;sid="&sidd&"'>删除全部帖子</a>"&we0&"")
		else
    		    %>
<%=we%>还没发表任何帖子！<%=we0%>
		<%
		end if
		Rs.close
	set rs=nothing

%><%=hr%>
<%=qingtian.qingsav("354")%><%=sou%><a href="chuwu.asp?sid=<%=sidd%>">我的物品</a>|<a href="shangchen.asp?sid=<%=sidd%>">商场</a>|<a href="index.asp?sid=<%=sidd%>">地盘</a><%=we0%>  
   <%
End Function
%>
